<docs>
## 最近浏览页面
</docs>
<template>
  <div class="con-layout lately noPadBottom">
    <my-bread title="最近浏览" :goback="true" ref="head"></my-bread>
    <div class="content">
      <div class="resume-con" ref="resumeCon">
        <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
          <resume-list
            v-for="(item,index) in list"
            :key="index"
            :visibleSlide="visibleSlide"
            :data="item"
            :showYs="false"
            @link="link_bank"
          ></resume-list>
        </van-list>
      </div>
    </div>
  </div>
</template>

<script>
import resumeList from "base/job/jobList";

export default {
  components: { resumeList },

  data() {
    return {
      visibleSlide: false,
      pageNum: 1,
      pageSize: 10,
      list: [],
      loading: false,
      finished: false
    };
  },
  methods: {
    link_bank(item) {
      this.$loading = true;
      this.$http({
        url: "/dwgl/jlckBc",
        method: "post",
        data: {
          dwdjid: item.dwdjid,
          jlid: item.jlid,
          jlly: item.jlly,
          tdjlid: item.tdjlid,
          ckjlid: item.ckjlid
        }
      }).finally(()=>{
        this.$loading = false;
      }).then(res => {
        let _res = res.returnData;
        if (+_res.executeResult == 1) {
          this.$router.push({
            path: "/resume/resumeDetail",
            query: {
              jlid: item.jlid,
              tdjlid: item.tdjlid,
              jlly: item.jlly
            }
          });
        } else {
          this.alert({
            message: _res.message
          });
        }
      });
    },
    onLoad() {
      this.$http({
        url: "/msgl/zjllck",
        method: "get",
        params: {
          pageNum: this.pageNum,
          pageSize: this.pageSize
        }
      }).then(res => {
        // 加载状态结束
        this.loading = false;
        this.finished = false;
        let data = res.returnData;
        if (+data.executeResult == 1) {
          this.pageNum++;
          this.list.push(...data.gwxxCx);
          if (this.pageNum > res.pageCount) {
            // 数据加载完毕
            this.finished = true;
          }
        } else {
          this.sildeShow = false;
          this.finished = true;
          return false;
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.lately {
  .content {
  }
  .resume-con {
    overflow: visible;
  }
}
</style>
